/*
 * @Description: 服务器管理
 * @Date: 2023-11-16 09:18:11
 * @FilePath: \hksj-vued:\03code\hk-iot\src\api\configuration\server\index.ts
 */
import request from '/@/utils/request';

/**
 * @method addServer 新增
 * @method deleteServer 删除
 * @method updateServer 修改
 * @method queryServerListByPaging 分页查询
 */
export function useServerApi() {
  return {
    addServer: (params: object) => {
      return request({
        url: '/api/mqtt/server/addServer',
        method: 'POST',
        data: params,
      });
    },
    deleteServer: (id: string) => {
      return request({
        url: `/api/mqtt/server/deleteServer/${id}`,
        method: 'DELETE',
      });
    },
    updateServer: (params: object) => {
      return request({
        url: '/api/mqtt/server/updateServer',
        method: 'PUT',
        data: params,
      });
    },
    queryServerListByPaging: (params: object) => {
      return request({
        url: '/api/mqtt/server/queryServerListByPaging',
        method: 'POST',
        data: params,
      });
    },
  };
}
